const http = require("http");
const fs = require("fs");
const path = require("path");

http.createServer((req, res) => {
    var filePath = path.join(__dirname, "/rest.html");
    if (req.url == "/") {
        var fileContent = fs.readFileSync(filePath);
        res.writeHead(200, { "Content-Type": "text/html;charset=utf-8" });
        res.write(fileContent);
        res.end();
    }
}).listen(3000);
